home *** CD-ROM | disk | FTP | other *** search
- Include "equ.h"
- Include "impequ.h"
-
- TAB equ 9
- CR equ $d
- LF equ $a
- FF equ $c
- ESC equ $1b
-
- SECTION firstword,CODE,PUBLIC
- ***************************************************
- *** ***
- ***************************************************
- dumbentry:
- clr.l d0
- rts
-
- dc.l "IMPT"
- dc.w 200
- dc.l 0
-
- table: dc.l 0
- dc.l name,special,check,_1stword
-
- *
- * 1stWord Check routine
- *
- check: move.l table,a0
- move.l buff1(a0),a1
- move.l (a1),a1
- cmp.b #$1f,(a1)+
- bne never
- moveq #2,d0
- irts: rts
-
-
- ***
- *** Text File Import
- ***
-
- *
- * First Word
- *
- _1stword:
- move.l table,a0
- move.l f_openr(a0),a0
- jsr (a0)
- beq ascii9
-
- move.l table,a0
- move.l t_open(a0),a0
- jsr (a0)
- beq ascii9
-
- clr.b crflag
- clr.b tabflag
- ascii1: move.l table,a0
- move.l f_get(a0),a0
- jsr (a0)
- beq ascii9
-
- cmp.b #$20,d0
- beq dotab
- cmp.b #$1f,d0
- beq header
- cmp.b #ESC,d0
- beq command
- cmp.b #$1e,d0
- beq dosp
- cmp.b #CR,d0
- beq docr
-
- and.w #$ff,d0
- lea ktoi,a0
- tst.b 0(a0,d0.w)
- bne tput
- bra ascii1
- *
- command:
- move.l table,a0
- move.l f_get(a0),a0
- jsr (a0)
- beq ascii9
- move.b d0,cmd
- move.b pcmd,d1
- and.b #%1111,d0
- and.b #%1111,d1
- cmp.b d0,d1
- beq noattrb
- moveq #0,d1
- btst #0,d0
- beq nbold
- bset #BOLD,d1
- nbold: btst #1,d0
- beq nlht
- bset #LIGHT,d1
- nlht: btst #2,d0
- beq nital
- bset #ITALICS,d1
- nital: btst #3,d0
- beq nuln
- bset #UNDER,d1
- nuln: move.w d1,-(sp)
- move.w #CMD_AT,d0
- move.l table,a0
- move.l t_putw(a0),a0
- jsr (a0)
- beq ascii9
- moveq #0,d0
- move.w (sp)+,d0
- move.l table,a0
- move.l t_putl(a0),a0
- jsr (a0)
- beq ascii9
-
- noattrb:
- move.b cmd,d0
- move.b pcmd,d1
- and.b #%110000,d0
- and.b #%110000,d1
- cmp.b d0,d1
- beq nobsln
-
- moveq #0,d1
- btst #4,d0
- beq nsuper
- move.w #200,d1
- nsuper: btst #5,d0
- beq nsub
- move.w #-200,d1
- nsub: move.w d1,-(sp)
- move.w #CMD_BMOD,d0
- move.l table,a0
- move.l t_putw(a0),a0
- jsr (a0)
- beq ascii9
- move.w (sp)+,d0
- move.l table,a0
- move.l t_putw(a0),a0
- jsr (a0)
- beq ascii9
-
- nobsln: move.b cmd,pcmd
- bra ascii1
- *
- header: move.l table,a0
- move.l f_get(a0),a0
- jsr (a0)
- beq ascii9
- cmp.b #LF,d0
- bne header
- bra ascii1
- *
- dosp: bset #0,crflag
- move.b #$20,d0
- bra tput0
- *
- docr: bclr #0,crflag
- bne ascii1
- move.w #CMD_CR,d0
- bra tputw
- *
- dotab: bset #0,tabflag
- bne ascii1
- move.w #CMD_TAB,d0
- bra tputw
- *
- * put as is
- *
- tput: move.b 0(a0,d0.w),d0
- clr.b crflag
- tput0: move.l table,a0
- move.l t_put(a0),a0
- jsr (a0)
- beq ascii9
- clr.b tabflag
- bra ascii1
- *
- * end of input file. close and flush buffer
- *
- ascii9: move.l table,a0
- move.l f_closer(a0),a0
- jsr (a0)
- move.l table,a0
- move.l t_close(a0),a0
- jmp (a0)
-
- tputw: move.l table,a0
- move.l t_putw(a0),a0
- jsr (a0)
- beq ascii9
- bra ascii1
-
-
- *******************************************************************
- *** called when the import routine choosen finds something ***
- *** wrong with the file loaded. ***
- *******************************************************************
- notright:
- rts
-
- never: moveq #0,d0
- rts
-
- maybe: moveq #1,d0
- rts
-
- right: moveq #2,d0
- rts
-
- ***********************************************************
- *** ***
- ***********************************************************
- SECTION firstword,DATA,PUBLIC
-
- *
- special:
- dc.w 1
- dc.l spcl1
- *
- name: dc.b "1st Word v2.0.1",0
- *
- spcl1: dc.b "Formatted Text",0
- *
-
- ktoi: dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$00-$07
- dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$08-$0f
- dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$10-$17
- dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$18-$1f
- dc.b $20,$21,$22,$23,$24,$25,$26,$27
- dc.b $28,$29,$2a,$2b,$2c,$2d,$2e,$2f
- dc.b $30,$31,$32,$33,$34,$35,$36,$37
- dc.b $38,$39,$3a,$3b,$3c,$3d,$3e,$3f
- dc.b $40,$41,$42,$43,$44,$45,$46,$47
- dc.b $48,$49,$4a,$4b,$4c,$4d,$4e,$4f
- dc.b $50,$51,$52,$53,$54,$55,$56,$57
- dc.b $58,$59,$5a,$5b,$5c,$5d,$5e,$5f
- dc.b $60,$61,$62,$63,$64,$65,$66,$67
- dc.b $68,$69,$6a,$6b,$6c,$6d,$6e,$6f
- dc.b $70,$71,$72,$73,$74,$75,$76,$77
- dc.b $78,$79,$7a,$7b,$7c,$7d,$7e,$00
- dc.b 199,252,233,226,228,224,229,231
- dc.b 234,235,232,239,238,236,196,197
- dc.b 201,230,198,244,246,242,251,249
- dc.b 254,214,220,162,163,161,187,164
- dc.b 225,237,243,250,241,209,189,156
- dc.b 185,000,141,145,144,186,136,137
- dc.b 227,245,159,191,247,215,192,195
- dc.b 213,000,000,180,181,183,184,182
- dc.b 000,000,138,000,000,000,000,000
- dc.b 000,000,000,000,000,000,000,000
- dc.b 000,000,000,000,000,000,000,000
- dc.b 000,000,000,000,000,165,000,151
- dc.b 000,000,000,150,000,000,153,000
- dc.b 000,000,000,000,000,160,000,000
- dc.b 131,140,135,134,000,000,139,130
- dc.b 155,172,171,128,147,148,149,173
-
-
- SECTION firstword,BSS,PUBLIC
-
- cmd: ds.b 1
- pcmd: ds.b 1
- crflag: ds.b 1
- tabflag: ds.b 1
-